/*
 * Objects that can be sent to a Buffer and received from the Buffer
 */
package client;

import java.io.Serializable;
import java.util.ArrayList;
import serveursvg.IMessageController.MessageType;

/**
 *
 *
 */
public class BufferMessage implements Serializable
{
    private MessageType messageType;
    private String source;
    private ArrayList<String> params;
    private int clock;
    private String content;

    public BufferMessage(MessageType messageType, ArrayList<String> params, int clock) {
        this.messageType = messageType;
        this.params = params;
        this.clock = clock;
    }

    public BufferMessage(MessageType messageType, String source, int clock, String content) {
        this.messageType = messageType;
        this.source = source;
        this.clock = clock;
        this.content = content;
    }

    public BufferMessage(MessageType messageType, String source, int clock) {
        this.messageType = messageType;
        this.source = source;
        this.clock = clock;
    }
    
    

    /**
     * Get the value of params
     *
     * @return the value of params
     */
    public ArrayList<String> getParams()
    {
        return params;
    }

    /**
     * Set the value of params
     *
     * @param params new value of params
     */
    public void setParams(ArrayList<String> params)
    {
        this.params = params;
    }


    /**
     * Get the value of messageType
     *
     * @return the value of messageType
     */
    public MessageType getMessageType()
    {
        return messageType;
    }

    /**
     * Set the value of messageType
     *
     * @param messageType new value of messageType
     */
    public void setMessageType(MessageType messageType)
    {
        this.messageType = messageType;
    }

    @Override
    public String toString()
    {
        return (messageType + ":" + params);
    }

    public int getClock() {
        return clock;
    }

    public void setClock(int clock) {
        this.clock = clock;
    }
}
